crPEGetSelectedPrinter

If the printer has been specified in Crystal Reports using the File|Printer Setup|Specific printer option, the crPEGetSelectedPrinter function will return information about that printer if the same driver is installed on the machine. If the driver has not been installed on the machine, it will return information about the default printer specified in the Printers Window of the Control Panel.

Declare Function crPEGetSelectedPrinter Lib "crwrap32.dll" Alias "crvbPEGetSelectedPrinter" (ByVal printJob As Integer, ByRef driverName As String, ByRef printerName As String, ByRef portName As String, crmode As crDEVMODE) As Integer

Parameters

printJob

Specifies the handle to the print job that you want to query to get information on the non-default printer that has been selected with the report.

driverName

Specifies the name of the printer driver for the printer that is selected with the print job.

printerName

Specifies the name of the printer that is selected with the print job.

portName

Specifies the name of the port to which the selected printer is connected.

crmode

Specifies the crDEVMODE structure.

Return Value

TRUE (1) if the call is successful, FALSE (0) if the call fails.



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com